<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>  
<!DOCTYPE html>
<html>
<head>
<title>菜单管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<jsp:include page="/WEB-INF/views/include/oldhead.jsp" />

</head>
<body>
	<form:form id="inputForm" modelAttribute="menu" action="${ctx}/sys/menu/save" method="post" class="form-horizontal btnbottom">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>
		<div class="panel fromheight">
			<div class="panel-body">
				<div class="line">
					<span>基本信息</span>
					<hr style="border: 1px dotted #ddd; width:100%;margin:0px;"/>
				</div>
				<ul class="form-box clearfix">
					<li>
						<p>上级菜单：</p>
						<div class="form-right">
							<sys:treeselect id="menu" name="parent.id" value="${menu.parent.id}" 
								labelName="parent.name" labelValue="${menu.parent.name}" title="菜单" 
								url="/sys/menu/treeData" extId="${menu.id}" cssClass="form-control required max-dialoginput"/>
						</div>
					</li>	
					<li>
						<p>名称：</p>
						<div class="form-right">
							<form:input path="name" htmlEscape="false" maxlength="50" class="form-control required"/>
							<span class="help-inline"><font color="red">*</font></span>
						</div>
					</li>
					<li>
						<p>链接：</p>
						<div class="form-right">
							<form:input path="href" htmlEscape="false" maxlength="2000" class="form-control"/>
							<span class="help-inline"><!-- 点击菜单跳转的页面 --></span>
						</div>
					</li>
					<li>
						<p>目标：</p>
						<div class="form-right">
							<form:input path="target" htmlEscape="false" maxlength="10" class="form-control"/>
							<span class="help-inline"><!-- 链接地址打开的目标窗口，默认：mainFrame --></span>
						</div>
					</li>
					<li>
						<p>权限标识：</p>
						<div class="form-right">
							<form:input path="permission" htmlEscape="false" maxlength="100" class="form-control"/>
							<span class="help-inline"><!-- 控制器中定义的权限标识，如：@RequiresPermissions("权限标识") --></span>
						</div>
					</li>
					<li>
						<p>排序：</p>
						<div class="form-right">
							<form:input path="sort" htmlEscape="false" maxlength="50" class="form-control required digits"/>
							<span class="help-inline"><!-- 排列顺序，升序。 --></span>
						</div>
					</li>
					<li>
						<p>是否可见：</p>
						<div class="form-right">
						    <form:select path="isShow" cssClass="form-control">
						         <form:option value="1">是</form:option>
						         <form:option value="0">否</form:option>
						    </form:select>
						</div>
					</li>
					<li>
						<p>图标：</p>
						<div class="form-right">
							<sys:iconselect id="icon" name="icon" value="${menu.icon}"/>
						</div>
					</li>
					<li class="full">
						<p>备注：</p>
						<div class="form-right">
							<form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" class="form-control g-textarea"/>
						</div>
					</li>
				</ul>		
<!-- 				<table width="100%" class="tb-from"> -->
<!-- 					<tr> -->
<!-- 						<th>上级菜单</th> -->
<!-- 						<td> -->
<%-- 							<sys:treeselect id="menu" name="parent.id" value="${menu.parent.id}"  --%>
<%-- 								labelName="parent.name" labelValue="${menu.parent.name}" title="菜单"  --%>
<%-- 								url="/sys/menu/treeData" extId="${menu.id}" cssClass="required max-dialoginput"/> --%>
<!-- 						</td> -->
<!-- 						<th>名称</th> -->
<!-- 						<td> -->
<%-- 							<form:input path="name" htmlEscape="false" maxlength="50" class="form-control required"/> --%>
<!-- 							<span class="help-inline"><font color="red">*</font></span> -->
<!-- 						</td> -->
<!-- 					</tr> -->
<!-- 					<tr> -->
<!-- 						<th>链接</th> -->
<!-- 						<td> -->
<%-- 							<form:input path="href" htmlEscape="false" maxlength="2000" class="form-control"/> --%>
<!-- 							<span class="help-inline">点击菜单跳转的页面</span> -->
<!-- 						</td> -->
<!-- 						<th>目标</th> -->
<!-- 						<td> -->
<%-- 							<form:input path="target" htmlEscape="false" maxlength="10" class="form-control"/> --%>
<!-- 							<span class="help-inline">链接地址打开的目标窗口，默认：mainFrame</span> -->
<!-- 						</td> -->
<!-- 					</tr> -->
<!-- 					<tr> -->
<!-- 						<th>权限标识</th> -->
<!-- 						<td> -->
<%-- 							<form:input path="permission" htmlEscape="false" maxlength="100" class="form-control"/> --%>
<!-- 							<span class="help-inline">控制器中定义的权限标识，如：@RequiresPermissions("权限标识")</span> -->
<!-- 						</td> -->
<!-- 						<th>排序</th> -->
<!-- 						<td> -->
<%-- 							<form:input path="sort" htmlEscape="false" maxlength="50" class="form-control required digits"/> --%>
<!-- 							<span class="help-inline">排列顺序，升序。</span> -->
<!-- 						</td> -->
<!-- 					</tr> -->
<!-- 					<tr> -->
<!-- 						<th>是否可见</th> -->
<!-- 						<td> -->
<%-- 							<form:radiobuttons path="isShow" items="${fns:getDictList('show_hide')}" itemLabel="label" itemValue="value" htmlEscape="false" class="required"/> --%>
<!-- 							<span class="help-inline">该菜单或操作是否显示到系统菜单中</span> -->
<!-- 						</td> -->
<!-- 						<th>图标</th> -->
<!-- 						<td> -->
<%-- 							<sys:iconselect id="icon" name="icon" value="${menu.icon}"/> --%>
<!-- 						</td> -->
<!-- 					</tr> -->
<!-- 					<tr> -->
<!-- 						<th>备注</th> -->
<!-- 						<td colspan=3> -->
<%-- 							<form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" class="form-control g-textarea"/> --%>
<!-- 						</td> -->
<!-- 					</tr> -->
<!-- 				</table> -->
			</div>
		</div>
		<div class="panel panel-default bottom">
			<div class="panel-heading center">
				<button type="submit" class="btn-custom">保存</button>
				<button type="button" class="btn-custom" onclick="top.$.jBox.close(true);">关闭</button>
			</div>
		</div>
	</form:form>
	<jsp:include page="/WEB-INF/views/include/pageJs.jsp" />
	
	<script type="text/javascript">
		$(document).ready(function() {
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</body>
</html>